home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / src / toolssrc / Deplex.sml < prev    next >
Encoding:
Text File  |  1997-08-18  |  17.8 KB  |  644 lines  |  [TEXT/Moml]

  1. local open Obj Lexing in
  2.  
  3.  
  4.   
  5. open Deppars Config;
  6.  
  7. (* For nesting comments *)
  8.  
  9. val comment_depth = ref 0;
  10.  
  11. (* The table of keywords *)
  12.  
  13. val keyword_table = (Hasht.new 53 : (string,token) Hasht.t);
  14.  
  15. val () =
  16. List.app (fn (str,tok) => Hasht.insert keyword_table str tok)
  17. [
  18.   ("abstype",    NULL),
  19.   ("and",        NULL),
  20.   ("andalso",    NULL),
  21.   ("as",         NULL),
  22.   ("case",       NULL),
  23.   ("datatype",   NULL),
  24.   ("do",         NULL),
  25.   ("else",       NULL),
  26.   ("eqtype",     NULL),
  27.   ("end",        NULL),
  28.   ("exception",  NULL),
  29.   ("fn",         NULL),
  30.   ("fun",        NULL),
  31.   ("handle",     NULL),
  32.   ("if",         NULL),
  33.   ("in",         NULL),
  34.   ("infix",      NULL),
  35.   ("infixr",     NULL),
  36.   ("let",        NULL),
  37.   ("local",      NULL),
  38.   ("nonfix",     NULL),
  39.   ("of",         NULL),
  40.   ("op",         NULL),
  41.   ("open",       OPEN),
  42.   ("orelse",     NULL),
  43.   ("prim_eqtype",  NULL),
  44.   ("prim_EQtype",  NULL),
  45.   ("prim_type",    NULL),
  46.   ("prim_val",     NULL),
  47.   ("raise",      NULL),
  48.   ("rec",        NULL),
  49.   ("then",       NULL),
  50.   ("type",       NULL),
  51.   ("val",        NULL),
  52.   ("while",      NULL),
  53.   ("with",       NULL),
  54.   ("withtype",   NULL),
  55.   ("#",          NULL),
  56.   ("->",         NULL),
  57.   ("|",          NULL),
  58.   (":",          NULL),
  59.   ("=>",         NULL),
  60.   ("=",          NULL),
  61.   ("*",          NULL)
  62. ];
  63.  
  64. fun mkKeyword lexbuf =
  65.   let val s = getLexeme lexbuf in
  66.     Hasht.find keyword_table s
  67.     handle Subscript => ID s
  68.   end
  69. ;
  70.  
  71. val savedLexemeStart = ref 0;
  72.  
  73. fun getQual s =
  74.   let open CharVector
  75.       val len' = size s - 1
  76.       fun parse n =
  77.         if n >= len' then
  78.         ""                (* This can't happen *)
  79.         else if sub(s, n) = #"." then
  80.         extract(s, 0, SOME n)
  81.         else
  82.         parse (n+1)
  83.   in parse 0 end;
  84.  
  85. fun mkQualId lexbuf =
  86.   QUAL_ID (getQual(getLexeme lexbuf));
  87.  
  88. fun lexError msg lexbuf = NULL;
  89.  
  90. fun incr r = (r := !r + 1);
  91. fun decr r = (r := !r - 1);
  92.  
  93.  
  94. fun action_42 lexbuf = (
  95. TokenN lexbuf)
  96. and action_41 lexbuf = (
  97.  lexError "this will be never called!" lexbuf )
  98. and action_40 lexbuf = (
  99.  TokenId lexbuf )
  100. and action_39 lexbuf = (
  101.  EOF )
  102. and action_38 lexbuf = (
  103.  NULL )
  104. and action_37 lexbuf = (
  105.  NULL )
  106. and action_36 lexbuf = (
  107.  NULL )
  108. and action_35 lexbuf = (
  109.  NULL )
  110. and action_34 lexbuf = (
  111.  NULL )
  112. and action_33 lexbuf = (
  113.  NULL )
  114. and action_32 lexbuf = (
  115.  NULL )
  116. and action_31 lexbuf = (
  117.  NULL )
  118. and action_30 lexbuf = (
  119.  NULL )
  120. and action_29 lexbuf = (
  121.  NULL )
  122. and action_28 lexbuf = (
  123.  NULL )
  124. and action_27 lexbuf = (
  125.  String lexbuf )
  126. and action_26 lexbuf = (
  127.  String lexbuf )
  128. and action_25 lexbuf = (
  129.  NULL )
  130. and action_24 lexbuf = (
  131.  NULL )
  132. and action_23 lexbuf = (
  133.  lexError "unmatched comment bracket" lexbuf )
  134. and action_22 lexbuf = (
  135.  savedLexemeStart := getLexemeStart lexbuf;
  136.         comment_depth := 1; Comment lexbuf; TokenN lexbuf
  137.       )
  138. and action_21 lexbuf = (
  139.  TokenN lexbuf )
  140. and action_20 lexbuf = (
  141.  lexError "ill-formed token" lexbuf )
  142. and action_19 lexbuf = (
  143.  mkQualId lexbuf )
  144. and action_18 lexbuf = (
  145.  mkKeyword lexbuf )
  146. and action_17 lexbuf = (
  147.  Comment lexbuf )
  148. and action_16 lexbuf = (
  149.  EOF )
  150. and action_15 lexbuf = (
  151.  (decr comment_depth;
  152.          if !comment_depth > 0 then Comment lexbuf else NULL) )
  153. and action_14 lexbuf = (
  154.  (incr comment_depth; Comment lexbuf) )
  155. and action_13 lexbuf = (
  156.  String lexbuf )
  157. and action_12 lexbuf = (
  158.  SkipString lexbuf )
  159. and action_11 lexbuf = (
  160.  EOF )
  161. and action_10 lexbuf = (
  162.  SkipString lexbuf )
  163. and action_9 lexbuf = (
  164.  String lexbuf )
  165. and action_8 lexbuf = (
  166.  String lexbuf )
  167. and action_7 lexbuf = (
  168.  String lexbuf )
  169. and action_6 lexbuf = (
  170.  String lexbuf )
  171. and action_5 lexbuf = (
  172.  NULL )
  173. and action_4 lexbuf = (
  174.  SkipString lexbuf )
  175. and action_3 lexbuf = (
  176.  EOF )
  177. and action_2 lexbuf = (
  178.  SkipString lexbuf )
  179. and action_1 lexbuf = (
  180.  SkipString lexbuf )
  181. and action_0 lexbuf = (
  182.  NULL )
  183. and state_0 lexbuf = (
  184.  let val currChar = getNextChar lexbuf in
  185.  case currChar of
  186.     #"\\" => state_69 lexbuf
  187.  |  #"\"" => action_0 lexbuf
  188.  |  #"\^Z" => action_3 lexbuf
  189.  |  #"\^@" => action_3 lexbuf
  190.  |  _ => action_4 lexbuf
  191.  end)
  192. and state_1 lexbuf = (
  193.  let val currChar = getNextChar lexbuf in
  194.  if currChar >= #"\^A" andalso currChar <= #"\^Y" then  action_12 lexbuf
  195.  else case currChar of
  196.     #"\127" => action_12 lexbuf
  197.  |  #"\255" => action_12 lexbuf
  198.  |  #"\\" => state_56 lexbuf
  199.  |  #"\"" => action_5 lexbuf
  200.  |  #"\^Z" => action_11 lexbuf
  201.  |  #"\^@" => action_11 lexbuf
  202.  |  _ => action_13 lexbuf
  203.  end)
  204. and state_2 lexbuf = (
  205.  let val currChar = getNextChar lexbuf in
  206.  case currChar of
  207.     #"*" => state_48 lexbuf
  208.  |  #"(" => state_47 lexbuf
  209.  |  #"\^Z" => action_16 lexbuf
  210.  |  #"\^@" => action_16 lexbuf
  211.  |  _ => action_17 lexbuf
  212.  end)
  213. and state_3 lexbuf = (
  214.  let val currChar = getNextChar lexbuf in
  215.  if currChar >= #"A" andalso currChar <= #"Z" then  state_38 lexbuf
  216.  else if currChar >= #"a" andalso currChar <= #"z" then  state_38 lexbuf
  217.  else case currChar of
  218.     #"!" => state_37 lexbuf
  219.  |  #"&" => state_37 lexbuf
  220.  |  #"%" => state_37 lexbuf
  221.  |  #"$" => state_37 lexbuf
  222.  |  #"#" => state_37 lexbuf
  223.  |  #"+" => state_37 lexbuf
  224.  |  #"*" => state_37 lexbuf
  225.  |  #"-" => state_37 lexbuf
  226.  |  #"/" => state_37 lexbuf
  227.  |  #":" => state_37 lexbuf
  228.  |  #"@" => state_37 lexbuf
  229.  |  #"?" => state_37 lexbuf
  230.  |  #">" => state_37 lexbuf
  231.  |  #"=" => state_37 lexbuf
  232.  |  #"<" => state_37 lexbuf
  233.  |  #"\\" => state_37 lexbuf
  234.  |  #"^" => state_37 lexbuf
  235.  |  #"`" => state_37 lexbuf
  236.  |  #"|" => state_37 lexbuf
  237.  |  #"~" => state_37 lexbuf
  238.  |  #"\^@" => backtrack lexbuf
  239.  |  _ => action_20 lexbuf
  240.  end)
  241. and state_4 lexbuf = (
  242.  setLexLastPos lexbuf (getLexCurrPos lexbuf);
  243.  setLexLastAction lexbuf (magic action_40);
  244.  let val currChar = getNextChar lexbuf in
  245.  if currChar >= #"0" andalso currChar <= #"9" then  state_16 lexbuf
  246.  else case currChar of
  247.     #"\r" => action_21 lexbuf
  248.  |  #"\t" => action_21 lexbuf
  249.  |  #"\n" => action_21 lexbuf
  250.  |  #" " => action_21 lexbuf
  251.  |  #"\^@" => action_39 lexbuf
  252.  |  #"\^Z" => action_39 lexbuf
  253.  |  #"~" => state_23 lexbuf
  254.  |  #"}" => action_32 lexbuf
  255.  |  #"{" => action_31 lexbuf
  256.  |  #"_" => action_28 lexbuf
  257.  |  #"]" => action_35 lexbuf
  258.  |  #"[" => action_33 lexbuf
  259.  |  #";" => action_38 lexbuf
  260.  |  #"." => state_15 lexbuf
  261.  |  #"," => action_29 lexbuf
  262.  |  #"*" => state_13 lexbuf
  263.  |  #")" => action_37 lexbuf
  264.  |  #"(" => state_11 lexbuf
  265.  |  #"'" => state_10 lexbuf
  266.  |  #"#" => state_9 lexbuf
  267.  |  #"\"" => action_26 lexbuf
  268.  |  _ => backtrack lexbuf
  269.  end)
  270. and state_5 lexbuf = (
  271.  setLexLastPos lexbuf (getLexCurrPos lexbuf);
  272.  setLexLastAction lexbuf (magic action_42);
  273.  let val currChar = getNextChar lexbuf in
  274.  case currChar of
  275.     _ => backtrack lexbuf
  276.  end)
  277. and state_9 lexbuf = (
  278.  let val currChar = getNextChar lexbuf in
  279.  case currChar of
  280.     #"[" => action_34 lexbuf
  281.  |  #"\"" => action_27 lexbuf
  282.  |  _ => backtrack lexbuf
  283.  end)
  284. and state_10 lexbuf = (
  285.  let val currChar = getNextChar lexbuf in
  286.  if currChar >= #"0" andalso currChar <= #"9" then  state_33 lexbuf
  287.  else if currChar >= #"A" andalso currChar <= #"Z" then  state_33 lexbuf
  288.  else if currChar >= #"a" andalso currChar <= #"z" then  state_33 lexbuf
  289.  else case currChar of
  290.     #"'" => state_33 lexbuf
  291.  |  #"_" => state_33 lexbuf
  292.  |  _ => backtrack lexbuf
  293.  end)
  294. and state_11 lexbuf = (
  295.  setLexLastPos lexbuf (getLexCurrPos lexbuf);
  296.  setLexLastAction lexbuf (magic action_36);
  297.  let val currChar = getNextChar lexbuf in
  298.  case currChar of
  299.     #"*" => action_22 lexbuf
  300.  |  _ => backtrack lexbuf
  301.  end)
  302. and state_13 lexbuf = (
  303.  let val currChar = getNextChar lexbuf in
  304.  case currChar of
  305.     #")" => action_23 lexbuf
  306.  |  _ => backtrack lexbuf
  307.  end)
  308. and state_15 lexbuf = (
  309.  let val currChar = getNextChar lexbuf in
  310.  case currChar of
  311.     #"." => state_29 lexbuf
  312.  |  _ => backtrack lexbuf
  313.  end)
  314. and state_16 lexbuf = (
  315.  setLexLastPos lexbuf (getLexCurrPos lexbuf);
  316.  setLexLastAction lexbuf (magic action_25);
  317.  let val currChar = getNextChar lexbuf in
  318.  if currChar >= #"0" andalso currChar <= #"9" then  state_16 lexbuf
  319.  else case currChar of
  320.     #"E" => state_25 lexbuf
  321.  |  #"." => state_24 lexbuf
  322.  |  _ => backtrack lexbuf
  323.  end)
  324. and state_23 lexbuf = (
  325.  let val currChar = getNextChar lexbuf in
  326.  if currChar >= #"0" andalso currChar <= #"9" then  state_16 lexbuf
  327.  else backtrack lexbuf
  328.  end)
  329. and state_24 lexbuf = (
  330.  let val currChar = getNextChar lexbuf in
  331.  if currChar >= #"0" andalso currChar <= #"9" then  state_28 lexbuf
  332.  else backtrack lexbuf
  333.  end)
  334. and state_25 lexbuf = (
  335.  let val currChar = getNextChar lexbuf in
  336.  if currChar >= #"0" andalso currChar <= #"9" then  state_26 lexbuf
  337.  else case currChar of
  338.     #"~" => state_27 lexbuf
  339.  |  _ => backtrack lexbuf
  340.  end)
  341. and state_26 lexbuf = (
  342.  setLexLastPos lexbuf (getLexCurrPos lexbuf);
  343.  setLexLastAction lexbuf (magic action_25);
  344.  let val currChar = getNextChar lexbuf in
  345.  if currChar >= #"0" andalso currChar <= #"9" then  state_26 lexbuf
  346.  else backtrack lexbuf
  347.  end)
  348. and state_27 lexbuf = (
  349.  let val currChar = getNextChar lexbuf in
  350.  if currChar >= #"0" andalso currChar <= #"9" then  state_26 lexbuf
  351.  else backtrack lexbuf
  352.  end)
  353. and state_28 lexbuf = (
  354.  setLexLastPos lexbuf (getLexCurrPos lexbuf);
  355.  setLexLastAction lexbuf (magic action_25);
  356.  let val currChar = getNextChar lexbuf in
  357.  if currChar >= #"0" andalso currChar <= #"9" then  state_28 lexbuf
  358.  else case currChar of
  359.     #"E" => state_25 lexbuf
  360.  |  _ => backtrack lexbuf
  361.  end)
  362. and state_29 lexbuf = (
  363.  let val currChar = getNextChar lexbuf in
  364.  case currChar of
  365.     #"." => action_30 lexbuf
  366.  |  _ => backtrack lexbuf
  367.  end)
  368. and state_33 lexbuf = (
  369.  setLexLastPos lexbuf (getLexCurrPos lexbuf);
  370.  setLexLastAction lexbuf (magic action_24);
  371.  let val currChar = getNextChar lexbuf in
  372.  if currChar >= #"0" andalso currChar <= #"9" then  state_33 lexbuf
  373.  else if currChar >= #"A" andalso currChar <= #"Z" then  state_33 lexbuf
  374.  else if currChar >= #"a" andalso currChar <= #"z" then  state_33 lexbuf
  375.  else case currChar of
  376.     #"'" => state_33 lexbuf
  377.  |  #"_" => state_33 lexbuf
  378.  |  _ => backtrack lexbuf
  379.  end)
  380. and state_37 lexbuf = (
  381.  setLexLastPos lexbuf (getLexCurrPos lexbuf);
  382.  setLexLastAction lexbuf (magic action_18);
  383.  let val currChar = getNextChar lexbuf in
  384.  case currChar of
  385.     #"!" => state_43 lexbuf
  386.  |  #"&" => state_43 lexbuf
  387.  |  #"%" => state_43 lexbuf
  388.  |  #"$" => state_43 lexbuf
  389.  |  #"#" => state_43 lexbuf
  390.  |  #"+" => state_43 lexbuf
  391.  |  #"*" => state_43 lexbuf
  392.  |  #"-" => state_43 lexbuf
  393.  |  #"/" => state_43 lexbuf
  394.  |  #":" => state_43 lexbuf
  395.  |  #"@" => state_43 lexbuf
  396.  |  #"?" => state_43 lexbuf
  397.  |  #">" => state_43 lexbuf
  398.  |  #"=" => state_43 lexbuf
  399.  |  #"<" => state_43 lexbuf
  400.  |  #"\\" => state_43 lexbuf
  401.  |  #"^" => state_43 lexbuf
  402.  |  #"`" => state_43 lexbuf
  403.  |  #"|" => state_43 lexbuf
  404.  |  #"~" => state_43 lexbuf
  405.  |  #"." => state_40 lexbuf
  406.  |  _ => backtrack lexbuf
  407.  end)
  408. and state_38 lexbuf = (
  409.  setLexLastPos lexbuf (getLexCurrPos lexbuf);
  410.  setLexLastAction lexbuf (magic action_18);
  411.  let val currChar = getNextChar lexbuf in
  412.  if currChar >= #"0" andalso currChar <= #"9" then  state_39 lexbuf
  413.  else if currChar >= #"A" andalso currChar <= #"Z" then  state_39 lexbuf
  414.  else if currChar >= #"a" andalso currChar <= #"z" then  state_39 lexbuf
  415.  else case currChar of
  416.     #"'" => state_39 lexbuf
  417.  |  #"_" => state_39 lexbuf
  418.  |  #"." => state_40 lexbuf
  419.  |  _ => backtrack lexbuf
  420.  end)
  421. and state_39 lexbuf = (
  422.  setLexLastPos lexbuf (getLexCurrPos lexbuf);
  423.  setLexLastAction lexbuf (magic action_18);
  424.  let val currChar = getNextChar lexbuf in
  425.  if currChar >= #"0" andalso currChar <= #"9" then  state_39 lexbuf
  426.  else if currChar >= #"A" andalso currChar <= #"Z" then  state_39 lexbuf
  427.  else if currChar >= #"a" andalso currChar <= #"z" then  state_39 lexbuf
  428.  else case currChar of
  429.     #"'" => state_39 lexbuf
  430.  |  #"_" => state_39 lexbuf
  431.  |  #"." => state_40 lexbuf
  432.  |  _ => backtrack lexbuf
  433.  end)
  434. and state_40 lexbuf = (
  435.  let val currChar = getNextChar lexbuf in
  436.  if currChar >= #"A" andalso currChar <= #"Z" then  state_42 lexbuf
  437.  else if currChar >= #"a" andalso currChar <= #"z" then  state_42 lexbuf
  438.  else case currChar of
  439.     #"!" => state_41 lexbuf
  440.  |  #"&" => state_41 lexbuf
  441.  |  #"%" => state_41 lexbuf
  442.  |  #"$" => state_41 lexbuf
  443.  |  #"#" => state_41 lexbuf
  444.  |  #"+" => state_41 lexbuf
  445.  |  #"*" => state_41 lexbuf
  446.  |  #"-" => state_41 lexbuf
  447.  |  #"/" => state_41 lexbuf
  448.  |  #":" => state_41 lexbuf
  449.  |  #"@" => state_41 lexbuf
  450.  |  #"?" => state_41 lexbuf
  451.  |  #">" => state_41 lexbuf
  452.  |  #"=" => state_41 lexbuf
  453.  |  #"<" => state_41 lexbuf
  454.  |  #"\\" => state_41 lexbuf
  455.  |  #"^" => state_41 lexbuf
  456.  |  #"`" => state_41 lexbuf
  457.  |  #"|" => state_41 lexbuf
  458.  |  #"~" => state_41 lexbuf
  459.  |  _ => backtrack lexbuf
  460.  end)
  461. and state_41 lexbuf = (
  462.  setLexLastPos lexbuf (getLexCurrPos lexbuf);
  463.  setLexLastAction lexbuf (magic action_19);
  464.  let val currChar = getNextChar lexbuf in
  465.  case currChar of
  466.     #"!" => state_41 lexbuf
  467.  |  #"&" => state_41 lexbuf
  468.  |  #"%" => state_41 lexbuf
  469.  |  #"$" => state_41 lexbuf
  470.  |  #"#" => state_41 lexbuf
  471.  |  #"+" => state_41 lexbuf
  472.  |  #"*" => state_41 lexbuf
  473.  |  #"-" => state_41 lexbuf
  474.  |  #"/" => state_41 lexbuf
  475.  |  #":" => state_41 lexbuf
  476.  |  #"@" => state_41 lexbuf
  477.  |  #"?" => state_41 lexbuf
  478.  |  #">" => state_41 lexbuf
  479.  |  #"=" => state_41 lexbuf
  480.  |  #"<" => state_41 lexbuf
  481.  |  #"\\" => state_41 lexbuf
  482.  |  #"^" => state_41 lexbuf
  483.  |  #"`" => state_41 lexbuf
  484.  |  #"|" => state_41 lexbuf
  485.  |  #"~" => state_41 lexbuf
  486.  |  _ => backtrack lexbuf
  487.  end)
  488. and state_42 lexbuf = (
  489.  setLexLastPos lexbuf (getLexCurrPos lexbuf);
  490.  setLexLastAction lexbuf (magic action_19);
  491.  let val currChar = getNextChar lexbuf in
  492.  if currChar >= #"0" andalso currChar <= #"9" then  state_42 lexbuf
  493.  else if currChar >= #"A" andalso currChar <= #"Z" then  state_42 lexbuf
  494.  else if currChar >= #"a" andalso currChar <= #"z" then  state_42 lexbuf
  495.  else case currChar of
  496.     #"'" => state_42 lexbuf
  497.  |  #"_" => state_42 lexbuf
  498.  |  _ => backtrack lexbuf
  499.  end)
  500. and state_43 lexbuf = (
  501.  setLexLastPos lexbuf (getLexCurrPos lexbuf);
  502.  setLexLastAction lexbuf (magic action_18);
  503.  let val currChar = getNextChar lexbuf in
  504.  case currChar of
  505.     #"!" => state_43 lexbuf
  506.  |  #"&" => state_43 lexbuf
  507.  |  #"%" => state_43 lexbuf
  508.  |  #"$" => state_43 lexbuf
  509.  |  #"#" => state_43 lexbuf
  510.  |  #"+" => state_43 lexbuf
  511.  |  #"*" => state_43 lexbuf
  512.  |  #"-" => state_43 lexbuf
  513.  |  #"/" => state_43 lexbuf
  514.  |  #":" => state_43 lexbuf
  515.  |  #"@" => state_43 lexbuf
  516.  |  #"?" => state_43 lexbuf
  517.  |  #">" => state_43 lexbuf
  518.  |  #"=" => state_43 lexbuf
  519.  |  #"<" => state_43 lexbuf
  520.  |  #"\\" => state_43 lexbuf
  521.  |  #"^" => state_43 lexbuf
  522.  |  #"`" => state_43 lexbuf
  523.  |  #"|" => state_43 lexbuf
  524.  |  #"~" => state_43 lexbuf
  525.  |  #"." => state_40 lexbuf
  526.  |  _ => backtrack lexbuf
  527.  end)
  528. and state_47 lexbuf = (
  529.  setLexLastPos lexbuf (getLexCurrPos lexbuf);
  530.  setLexLastAction lexbuf (magic action_17);
  531.  let val currChar = getNextChar lexbuf in
  532.  case currChar of
  533.     #"*" => action_14 lexbuf
  534.  |  _ => backtrack lexbuf
  535.  end)
  536. and state_48 lexbuf = (
  537.  setLexLastPos lexbuf (getLexCurrPos lexbuf);
  538.  setLexLastAction lexbuf (magic action_17);
  539.  let val currChar = getNextChar lexbuf in
  540.  case currChar of
  541.     #")" => action_15 lexbuf
  542.  |  _ => backtrack lexbuf
  543.  end)
  544. and state_56 lexbuf = (
  545.  setLexLastPos lexbuf (getLexCurrPos lexbuf);
  546.  setLexLastAction lexbuf (magic action_10);
  547.  let val currChar = getNextChar lexbuf in
  548.  if currChar >= #"0" andalso currChar <= #"9" then  state_59 lexbuf
  549.  else case currChar of
  550.     #"\"" => action_6 lexbuf
  551.  |  #"\\" => action_6 lexbuf
  552.  |  #"n" => action_6 lexbuf
  553.  |  #"t" => action_6 lexbuf
  554.  |  #"\r" => state_57 lexbuf
  555.  |  #"\t" => state_57 lexbuf
  556.  |  #"\n" => state_57 lexbuf
  557.  |  #" " => state_57 lexbuf
  558.  |  #"^" => state_60 lexbuf
  559.  |  _ => backtrack lexbuf
  560.  end)
  561. and state_57 lexbuf = (
  562.  let val currChar = getNextChar lexbuf in
  563.  case currChar of
  564.     #"\r" => state_57 lexbuf
  565.  |  #"\t" => state_57 lexbuf
  566.  |  #"\n" => state_57 lexbuf
  567.  |  #" " => state_57 lexbuf
  568.  |  #"\\" => action_7 lexbuf
  569.  |  _ => backtrack lexbuf
  570.  end)
  571. and state_59 lexbuf = (
  572.  let val currChar = getNextChar lexbuf in
  573.  if currChar >= #"0" andalso currChar <= #"9" then  state_62 lexbuf
  574.  else backtrack lexbuf
  575.  end)
  576. and state_60 lexbuf = (
  577.  let val currChar = getNextChar lexbuf in
  578.  if currChar >= #"@" andalso currChar <= #"_" then  action_8 lexbuf
  579.  else backtrack lexbuf
  580.  end)
  581. and state_62 lexbuf = (
  582.  let val currChar = getNextChar lexbuf in
  583.  if currChar >= #"0" andalso currChar <= #"9" then  action_9 lexbuf
  584.  else backtrack lexbuf
  585.  end)
  586. and state_69 lexbuf = (
  587.  setLexLastPos lexbuf (getLexCurrPos lexbuf);
  588.  setLexLastAction lexbuf (magic action_4);
  589.  let val currChar = getNextChar lexbuf in
  590.  case currChar of
  591.     #"\"" => action_1 lexbuf
  592.  |  #"\\" => action_1 lexbuf
  593.  |  #"n" => action_1 lexbuf
  594.  |  #"t" => action_1 lexbuf
  595.  |  #"\r" => state_70 lexbuf
  596.  |  #"\t" => state_70 lexbuf
  597.  |  #"\n" => state_70 lexbuf
  598.  |  #" " => state_70 lexbuf
  599.  |  _ => backtrack lexbuf
  600.  end)
  601. and state_70 lexbuf = (
  602.  let val currChar = getNextChar lexbuf in
  603.  case currChar of
  604.     #"\r" => state_70 lexbuf
  605.  |  #"\t" => state_70 lexbuf
  606.  |  #"\n" => state_70 lexbuf
  607.  |  #" " => state_70 lexbuf
  608.  |  #"\\" => action_2 lexbuf
  609.  |  _ => backtrack lexbuf
  610.  end)
  611. and Token lexbuf =
  612.   (setLexStartPos lexbuf (getLexCurrPos lexbuf);
  613.    state_5 lexbuf)
  614.  
  615. and TokenN lexbuf =
  616.   (setLexStartPos lexbuf (getLexCurrPos lexbuf);
  617.    state_4 lexbuf)
  618.  
  619. and TokenId lexbuf =
  620.   (setLexStartPos lexbuf (getLexCurrPos lexbuf);
  621.    state_3 lexbuf)
  622.  
  623. and Comment lexbuf =
  624.   (setLexStartPos lexbuf (getLexCurrPos lexbuf);
  625.    state_2 lexbuf)
  626.  
  627. and String lexbuf =
  628.   (setLexStartPos lexbuf (getLexCurrPos lexbuf);
  629.    state_1 lexbuf)
  630.  
  631. and SkipString lexbuf =
  632.   (setLexStartPos lexbuf (getLexCurrPos lexbuf);
  633.    state_0 lexbuf)
  634.  
  635. (* The following checks type consistency of actions *)
  636. val _ = fn _ => [action_42, action_41];
  637. val _ = fn _ => [action_40, action_39, action_38, action_37, action_36, action_35, action_34, action_33, action_32, action_31, action_30, action_29, action_28, action_27, action_26, action_25, action_24, action_23, action_22, action_21];
  638. val _ = fn _ => [action_20, action_19, action_18];
  639. val _ = fn _ => [action_17, action_16, action_15, action_14];
  640. val _ = fn _ => [action_13, action_12, action_11, action_10, action_9, action_8, action_7, action_6, action_5];
  641. val _ = fn _ => [action_4, action_3, action_2, action_1, action_0];
  642.  
  643. end
  644.